import java.awt.Rectangle;


public class BlockSprite extends Sprite {
	private int matrixLocX;
	private int matrixLocY;

	public BlockSprite(int x, int y, int w, int h, ImagesLoader imsLd, String name, int initialVelocity) {
		super(x, y, 0, 0, imsLd, name);
		matrixLocX = w;
		matrixLocY = h;
		setStep(0, initialVelocity);
	}
	
	public BlockSprite(int x, int y, ImagesLoader imsLd, String name, int initialVelocity) {
		super(x, y, 0, 0, imsLd, name);
		setStep(0, initialVelocity);
	}

	public void updateSprite()
	  // move the sprite
	  {
	    super.updateSprite();
		if (isActive()) {
	      locx += dx;
	      locy += dy;
	    }
	    
	  } // end of updateSprite()

	public int getMatrixLocX() {
		return matrixLocX;
	}

	public void setMatrixLocX(int matrixLocX) {
		this.matrixLocX = matrixLocX;
	}

	public int getMatrixLocY() {
		return matrixLocY;
	}

	public void setMatrixLocY(int matrixLocY) {
		this.matrixLocY = matrixLocY;
	}
	
	public boolean isAt(int x, int y){
		if(matrixLocX == x && matrixLocY ==y){
			return true;
		}
		return false;
	}

	public Rectangle getMyRectangle(int offsetX, int offsetY) {
		Rectangle offsetRect = getMyRectangle();
		offsetRect.translate(offsetX, offsetY);
		return offsetRect;
	}

}
